Skip to content

fix(dashboard): change bridgeId to bridge name#1498

Open
0xVance wants to merge 2 commits into
developfrom
fix/1453-improve-bridge-info
Open

fix(dashboard): change bridgeId to bridge name#1498
0xVance wants to merge 2 commits into
developfrom
fix/1453-improve-bridge-info

Conversation

@0xVance

@0xVance 0xVance commented Sep 19, 2022

Copy link
Copy Markdown
Contributor

Fixes #1453

@niemam29 @MilanVojnovic95 I'm ashamed to ask such question but I can't figure out how to make bridge transactions without spending money - would you be so kind and check if names are displayed properly? I coded them to be:
image

@netlify

netlify Bot commented Sep 19, 2022

Copy link
Copy Markdown

Deploy Preview for swapr ready!

Name Link
🔨 Latest commit 4c67cc0
🔍 Latest deploy log https://app.netlify.com/sites/swapr/deploys/632a36cf5801ec0009a0b63e
😎 Deploy Preview https://deploy-preview-1498--swapr.netlify.app/
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@github-actions github-actions Bot temporarily deployed to fix-1453-improve-bridge-info September 19, 2022 22:49 Destroyed
@niemam29

niemam29 commented Sep 20, 2022

Copy link
Copy Markdown
Contributor

@0xVance Only way to bridge without assets is to use testnets (Rinkeby -> A.Rinkeby)
It looks good to me but it would be nice if someone with more assets could tests that because i got real assets just to test socket

Comment thread src/pages/Account/accountUtils.ts Outdated
Comment on lines +22 to +36
export const mapBridgeIdToDisplayName = (bridgeId: BridgeList) => {
switch (bridgeId) {
case 'arbitrum:mainnet':
case 'arbitrum:testnet':
return 'Arbitrum'
case 'connext':
return 'Connext'
case 'omnibridge:eth-xdai':
return 'Omnibridge'
case 'socket':
return 'Socket'
case 'xdai':
return 'xDai'
}
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In this case is better to create a dictionary and map key to value :)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also maybe we should have a different name for Arbitrum mainnet and Arbitrum testnet as it may confuse users.

type: new RegExp('^(?<type>[A-Za-z]+)'),
}

export const bridgeIdToDisplayNameMap: { [k in BridgeList]: string } = {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we usually type global constant names with UPPER_CASE convention

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree here

@adamazad adamazad left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What @berteotti mentioned, otherwise looks

type: new RegExp('^(?<type>[A-Za-z]+)'),
}

export const bridgeIdToDisplayNameMap: { [k in BridgeList]: string } = {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

User dashboard: bridge info improvement

5 participants